/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.tkgarment.system.action;

/**
 *
 * @author zraj
 */
public class LoginAction extends ActionSupportBase{
    
    String userName;
    String passWord;
    
    @Override
    public String execute()throws Exception {
        return "success";
    }
    
    public String doLogin()throws Exception {
        if (this.userName.compareTo("admin") == 0 && this.passWord.compareTo("tk") == 0) {
          return "success";    
        }else{
            this.setMessage("username หรือ password ผิดพลาด กรุณากรอกใหม่ค่ะ");
          return INPUT;
        }
        
    }
    
    public String doLogout() throws Exception {
        return "success";
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }
    
    
    
    
    
    
}
